package com.itranswarp.learnjava.service;

import org.springframework.stereotype.Component;
import org.springframework.core.annotation.Order;

@Component
@Order(1)
public class ValidateName implements ValidateInterface {
    @Override
    public void validate(String email, String phone, String name) {
        if (name == null || name.length() < 2 || name.length() > 10) {
            throw new IllegalArgumentException("invalid name: " + name);
        }
    }
}